package com.ease.framework.gef4p.figures.impl {
   import flash.display.Graphics;
   import flash.geom.Point;

   public class PolylineStype {
      public function PolylineStype() {
      }

      public static function draw(graphics:Graphics, points:Array, currentColor:uint = 0x000000, currentWidth:int = 1):void {


         var i:int;
         for (i = 0; i < points.length - 1; i++) {
            drawLine(graphics, points[i], points[i + 1], currentColor, currentWidth);
         }
      }

      private static function drawLine(graphics:Graphics, startPoint:Point, endPoint:Point, currentColor:uint = 0x000000, currentWidth:int = 1):void {
         graphics.lineStyle(1, 0x000000, 4.0);

         //绘制阴影线，主要便于便于选择.

         graphics.lineStyle(2, 0xFFFFFF, 0.1);
         graphics.moveTo(startPoint.x, startPoint.y - 1);
         graphics.lineTo(endPoint.x, endPoint.y - 1);

         graphics.lineStyle(4, 0xC2DCC4, 0.3);
         graphics.moveTo(startPoint.x + 2, startPoint.y + 2);
         graphics.lineTo(endPoint.x + 2, endPoint.y + 2);

         graphics.lineStyle(currentWidth, currentColor, 4.0);
         graphics.moveTo(startPoint.x, startPoint.y);
         graphics.lineTo(endPoint.x, endPoint.y);

      }

   }
}